/*
 * userCenter.js
 */
var isIE = navigator.appName.indexOf("Internet Explorer") != -1;

var studentLiList = [];
var studentContentList = [];
var studentLiListStr = "stuPersonalMainPageLi,stuFriendsLi,stuTeachersLi,stuStudyCourseLi,stuStudyRecordLi,stuHeadPortraitManageLi,stuProfileLi,stuInvitationLetterLi,stuInformLi,stuRemainGoldenBeansLi,stuRemainAnswerTimeLi,stuPurchaseGoldenBeansLi,stuPurchaseAnswerTimeLi,stuOrderFormsLi,stuShoppingCartLi,stuPurchaseRecordLi"; 
var studentContentListStr = "stuPersonalMainPage,stuFriends,stuTeachers,stuStudyCourse,stuStudyRecord,stuHeadPortraitManage,stuProfile,stuInvitationLetter,stuInform,stuRemainGoldenBeans,stuRemainAnswerTime,stuPurchaseGoldenBeans,stuPurchaseAnswerTime,stuOrderForms,stuShoppingCart,stuPurchaseRecord"; 

$(document).ready(function(){
	if(isIE){
		$("#studentInfoPanel input").attr("unselectable", "on");
	}else{
		$("#studentInfoPanel input").attr("disabled","disabled");
	}
	studentLiList = studentLiListStr.split(",");
	studentContentList = studentContentListStr.split(",");
 });

function editProfile(){
	
	if(isIE){
		$("#studentInfoPanel input").attr("unselectable", "off");
	}else{
		$("#studentInfoPanel input").removeAttr("disabled");
	}
	
	$("#studentInfoPanel input").css("border-width","1px");
	$("#editProfile").css("display", "none");
	$("#saveProfile").css("display", "block");
	$("#cancelProfile").css("display", "block");
}

function saveProfile(){
	
	if(isIE){
		$("#studentInfoPanel input").attr("unselectable", "on");
	}else{
		$("#studentInfoPanel input").attr("disabled","disabled");
	}
	
	$("#studentInfoPanel input").css("border-width","0px");
	$("#editProfile").css("display", "block");
	$("#saveProfile").css("display", "none");
	$("#cancelProfile").css("display", "none");
}

function cancelProfile(){

	if(isIE){
		$("#studentInfoPanel input").attr("unselectable", "on");
	}else{
		$("#studentInfoPanel input").attr("disabled","disabled");
	}
	$("#studentInfoPanel input").css("border-width","0px");
	$("#editProfile").css("display", "block");
	$("#saveProfile").css("display", "none");
	$("#cancelProfile").css("display", "none");
}


function studentProfileOnclick(studentInfoLi,studentInfoContent){
	var i=0;
	for(i; i<studentLiList.length; i++){
		$("#" + studentLiList[i]).removeClass("active");
		$("#" + studentContentList[i]).addClass("hide");
	}
	$("#" + studentInfoLi).addClass("active");
	$("#" + studentInfoContent).removeClass("hide");
}


